<?php

/**
 * 类的继承
 */
class Notify
{
    public function message()
    {
        return '发送消息';
    }
}

class User extends Notify
{
    public function register()
    {
        return $this->message();
    }
}

class Comment extends Notify
{

    public function send()
    {
        return $this->message();
    }
}

echo (new User)->register();
echo (new Comment)->send();